Eclipse JDT
Pre-release 3.0

org.eclipse.jdt.core.search
Class SearchPattern

java.lang.Object
  extended byorg.eclipse.jdt.internal.core.search.pattern.InternalSearchPattern
      extended byorg.eclipse.jdt.core.search.SearchPattern
All Implemented Interfaces:
org.eclipse.jdt.internal.core.search.indexing.IIndexConstants, IJavaSearchConstants, ISearchPattern

public abstract class SearchPattern
extends org.eclipse.jdt.internal.core.search.pattern.InternalSearchPattern
implements ISearchPattern, org.eclipse.jdt.internal.core.search.indexing.IIndexConstants, IJavaSearchConstants

TODO (jerome) spec

Since:
3.0

Field Summary
 boolean mustResolve
           
static int R_CASE_SENSITIVE
          Match rule: The search pattern matches the search result only if cases are the same.
static int R_EXACT_MATCH
          Match rule: The search pattern matches exactly the search result, that is, the source of the search result equals the search pattern.
static int R_PATTERN_MATCH
          Match rule: The search pattern contains one or more wild cards ('*') where a wild-card can replace 0 or more characters in the search result.
static int R_PREFIX_MATCH
          Match rule: The search pattern is a prefix of the search result.
static int R_REGEXP_MATCH
          Match rule: The search pattern contains a regular expression.
 
Fields inherited from class org.eclipse.jdt.internal.core.search.pattern.InternalSearchPattern
focus, kind, matchRule
 
Fields inherited from interface org.eclipse.jdt.internal.core.search.indexing.IIndexConstants
CLASS_DECL, CLASS_SUFFIX, CONSTRUCTOR_DECL, CONSTRUCTOR_PATTERN, CONSTRUCTOR_REF, COUNTS, FIELD_DECL, FIELD_PATTERN, FIELD_REF, INTERFACE_DECL, INTERFACE_SUFFIX, LOCAL_VAR_PATTERN, METHOD_DECL, METHOD_PATTERN, METHOD_REF, OBJECT, ONE_STAR, ONE_STAR_CHAR, ONE_ZERO, ONE_ZERO_CHAR, OR_PATTERN, PKG_DECL_PATTERN, PKG_REF_PATTERN, REF, SEPARATOR, SUPER_REF, SUPER_REF_PATTERN, TYPE_DECL, TYPE_DECL_LENGTH, TYPE_DECL_PATTERN, TYPE_REF, TYPE_REF_PATTERN, TYPE_SUFFIX
 
Fields inherited from interface org.eclipse.jdt.core.search.IJavaSearchConstants
ALL_OCCURRENCES, CANCEL_IF_NOT_READY_TO_SEARCH, CASE_INSENSITIVE, CASE_SENSITIVE, CLASS, CONSTRUCTOR, DECLARATIONS, EXACT_MATCH, FIELD, FORCE_IMMEDIATE_SEARCH, IMPLEMENTORS, INTERFACE, METHOD, PACKAGE, PATTERN_MATCH, PREFIX_MATCH, READ_ACCESSES, REFERENCES, TYPE, UNKNOWN, WAIT_UNTIL_READY_TO_SEARCH, WRITE_ACCESSES
 
Constructor Summary
SearchPattern(int patternKind, int matchRule)
           
 
Method Summary
static SearchPattern createPattern(IJavaElement element, int limitTo)
           
static SearchPattern createPattern(String patternString, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive)
           
abstract  void decodeIndexKey(char[] key)
          Decoded the given index key into the given record.
abstract  char[] encodeIndexKey()
          Returns a key to find in relevant index categories.
abstract  SearchPattern getIndexRecord()
           
abstract  char[][] getMatchCategories()
          Returns an array of index categories to consider for this index query.
 int getMatchRule()
          Returns the rule to apply for matching index keys.
abstract  boolean isMatchingIndexRecord()
          TODO (jerome) spec
 boolean matchesName(char[] pattern, char[] name)
          Returns whether the given name matches the given pattern.
 String toString()
           
 
Methods inherited from class org.eclipse.jdt.internal.core.search.pattern.InternalSearchPattern
encodeIndexKey, findIndexMatches, findIndexMatches, findIndexMatches, findMatches, isCaseSensitive, isPolymorphicSearch, matchMode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

R_EXACT_MATCH

public static final int R_EXACT_MATCH
Match rule: The search pattern matches exactly the search result, that is, the source of the search result equals the search pattern.

See Also:
Constant Field Values

R_PREFIX_MATCH

public static final int R_PREFIX_MATCH
Match rule: The search pattern is a prefix of the search result.

See Also:
Constant Field Values

R_PATTERN_MATCH

public static final int R_PATTERN_MATCH
Match rule: The search pattern contains one or more wild cards ('*') where a wild-card can replace 0 or more characters in the search result.

See Also:
Constant Field Values

R_REGEXP_MATCH

public static final int R_REGEXP_MATCH
Match rule: The search pattern contains a regular expression.

See Also:
Constant Field Values

R_CASE_SENSITIVE

public static final int R_CASE_SENSITIVE
Match rule: The search pattern matches the search result only if cases are the same. Can be combined to previous rules, e.g. R_EXACT_MATCH | R_CASE_SENSITIVE

See Also:
Constant Field Values

mustResolve

public boolean mustResolve
Constructor Detail

SearchPattern

public SearchPattern(int patternKind,
                     int matchRule)
Method Detail

createPattern

public static SearchPattern createPattern(String patternString,
                                          int searchFor,
                                          int limitTo,
                                          int matchMode,
                                          boolean isCaseSensitive)

createPattern

public static SearchPattern createPattern(IJavaElement element,
                                          int limitTo)

decodeIndexKey

public abstract void decodeIndexKey(char[] key)
Decoded the given index key into the given record.


encodeIndexKey

public abstract char[] encodeIndexKey()
Returns a key to find in relevant index categories. The key will be matched according to some match rule. These potential matches will be further narrowed by the match locator, but precise match locating can be expensive, and index query should be as accurate as possible so as to eliminate obvious false hits.


getIndexRecord

public abstract SearchPattern getIndexRecord()

getMatchCategories

public abstract char[][] getMatchCategories()
Returns an array of index categories to consider for this index query. These potential matches will be further narrowed by the match locator, but precise match locating can be expensive, and index query should be as accurate as possible so as to eliminate obvious false hits.


getMatchRule

public int getMatchRule()
Returns the rule to apply for matching index keys. Can be exact match, prefix match, pattern match or regexp match. Rule can also be combined with a case sensitivity flag.


isMatchingIndexRecord

public abstract boolean isMatchingIndexRecord()
TODO (jerome) spec


matchesName

public boolean matchesName(char[] pattern,
                           char[] name)
Returns whether the given name matches the given pattern.


toString

public String toString()

Eclipse JDT
Pre-release 3.0

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.